// Author: combacsa@kaist.ac.kr
// http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=124

//#define COMPILE
#ifdef COMPILE

#include <fstream>
using namespace std;

int main() {
	ifstream in("input.txt");
	int m;
	in >> m;
	in.close();
	ofstream out("output.txt");
	switch (m) {
	case 1:
	case 3:
	case 5:
	case 7:
	case 8:
	case 10:
	case 12:
		out << 31;
		break;
	case 2:
		out << 28;
		break;
	case 4:
	case 6:
	case 9:
	case 11:
		out << 30;
		break;
	}
	out << endl;
	out.close();

	return 0;
}
#endif
